import type { MockMethod } from "vite-plugin-mock"
const productList = [
    {
        id: 1,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        goods_brand: '晨风华容',
        category: '日用-雨具',
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 2,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        goods_brand: '晨风华容',
        category: '日用-雨具',
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 3,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        goods_brand: '晨风华容',
        category: '日用-雨具',
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 4,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        goods_brand: '晨风华容',
        category: '日用-雨具',
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 5,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        goods_brand: '晨风华容',
        category: '日用-雨具',
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 6,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        goods_brand: '晨风华容',
        category: '日用-雨具',
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 7,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        goods_brand: '晨风华容',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        category: '日用-雨具',
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 8,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        goods_brand: '晨风华容',
        category: '日用-雨具',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 9,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        goods_brand: '晨风华容',
        category: '日用-雨具',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 10,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        goods_brand: '晨风华容',
        category: '日用-雨具',
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 11,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        goods_brand: '晨风华容',
        category: '日用-雨具',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },
    {
        id: 12,
        goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
        goods_name: '天堂伞',
        goods_brand: '晨风华容',
        category: '日用-雨具',
        text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
        chandd: '江苏',
        primary_price: 17,
        price: 15.5,
        goods_stock: 10,
        sku: 1646464,
        goods_details: '商品详情',
        recommendation: '感谢您使用华容，我们为您遮风挡雨'
    },

]
const mock: Array<MockMethod> = [
    /**
     * 测试接口
     */
    {
        // 接口路径
        url: '/api/test',

        // 接口方法
        method: 'get',

        // 返回数据
        response: () => {
            return {
                status: 200,
                message: 'success',
                data: 'Hello World'
            }
        }
    },
    /**
     * 路由数据接口
     */
    {
        url: '/api/routes',
        method: 'get',
        response: () => {
            // 路由
            const routes = [
                {
                    path: '/PageOne',
                    name: 'PageOne',
                    component: 'PageOne.vue'
                }, {
                    path: '/PageTwo',
                    name: 'PageTwo',
                    component: 'PageTwo.vue'
                }, {
                    path: '/PageThree',
                    name: 'PageThree',
                    component: 'PageThree.vue',
                }
            ]

            return {
                status: 200,
                message: 'success',
                data: routes
            }
        }
    },
    {
        url: '/api/getProductList',
        method: 'post',
        response: () => {
            // 路由
            const list = [
                {
                    name: '叫花鸡',
                    pic: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
                    price: '30',
                    store: 0,
                    text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。']
                }, {
                    name: '叫花鸡',
                    pic: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
                    price: '30',
                    store: 0,
                    text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。']
                }, {
                    name: '叫花鸡',
                    pic: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
                    price: '30',
                    store: 0,
                    text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。']
                }
            ]

            return {
                status: 200,
                message: 'success',
                data: productList
            }
        }
    },
    {
        url: '/api/productDetail',
        method: 'post',
        response: () => {
            // 路由
            const list = [
                {
                    name: '叫花鸡',
                    pic: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
                    price: '30',
                    store: 0,
                    text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。']
                }, {
                    name: '叫花鸡',
                    pic: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
                    price: '30',
                    store: 0,
                    text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。']
                }, {
                    name: '叫花鸡',
                    pic: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
                    price: '30',
                    store: 0,
                    text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。']
                }
            ]

            return {
                status: 200,
                message: 'success',
                data: {
                    id: 12,
                    goodsBanner: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png',
                    goods_name: '天堂伞',
                    goods_brand: '晨风华容',
                    category: '日用-雨具',
                    text: ['罗氏香喷喷叫花鸡', '真空包装，质量保证。'],
                    chandd: '江苏',
                    primary_price: 17,
                    price: 15.5,
                    goods_stock: 10,
                    sku: 1646464,
                    goods_details: '商品详情',
                    recommendation: '感谢您使用华容，我们为您遮风挡雨'
                },
            }
        }
    }
]

export default mock